package com.kexilo.core.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import com.kexilo.core.common.core.domain.BaseEntity;
import com.kexilo.core.common.validation.UpdateGroup;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;


/**
 * 字典数据表 kx_sys_dict_data
 * 
 * @author Kexilo
 */
@TableName("kx_sys_dict_data")
public class SysDictData extends BaseEntity {
    
    private static final long serialVersionUID = 1L;

    /** 字典编码 */
    @TableId(type = IdType.AUTO)
    @NotNull(message = "字典数据ID不能为空", groups = { UpdateGroup.class })
    private Long dictCode;

    /** 字典排序 */
    private Integer dictSort;

    /** 字典标签 */
    @NotBlank(message = "字典标签不能为空")
    @Size(max = 100, message = "字典标签长度不能超过100个字符")
    private String dictLabel;

    /** 字典键值 */
    @NotBlank(message = "字典键值不能为空")
    @Size(max = 100, message = "字典键值长度不能超过100个字符")
    private String dictValue;

    /** 字典类型 */
    @NotBlank(message = "字典类型不能为空")
    @Size(max = 100, message = "字典类型长度不能超过100个字符")
    private String dictType;

    /** 样式属性（其他样式扩展） */
    @Size(max = 100, message = "样式属性长度不能超过100个字符")
    private String cssClass;

    /** 表格字典样式 */
    private String listClass;

    /** 是否默认（Y是 N否） */
    private String isDefault;

    /** 状态（0正常 1停用） */
    private String status;

    /** 备注 */
    private String remark;

    @TableField(exist = false)
    private boolean flag = false;

    public SysDictData() {

    }

    public SysDictData(String dictType) {
        this.dictType = dictType;
    }

    // Getter methods
    public Long getDictCode() {
        return dictCode;
    }

    public Integer getDictSort() {
        return dictSort;
    }

    public String getDictLabel() {
        return dictLabel;
    }

    public String getDictValue() {
        return dictValue;
    }

    public String getDictType() {
        return dictType;
    }

    public String getCssClass() {
        return cssClass;
    }

    public String getListClass() {
        return listClass;
    }

    public String getIsDefault() {
        return isDefault;
    }

    public String getStatus() {
        return status;
    }

    public String getRemark() {
        return remark;
    }

    public boolean isFlag() {
        return flag;
    }

    // Setter methods
    public void setDictCode(Long dictCode) {
        this.dictCode = dictCode;
    }

    public void setDictSort(Integer dictSort) {
        this.dictSort = dictSort;
    }

    public void setDictLabel(String dictLabel) {
        this.dictLabel = dictLabel;
    }

    public void setDictValue(String dictValue) {
        this.dictValue = dictValue;
    }

    public void setDictType(String dictType) {
        this.dictType = dictType;
    }

    public void setCssClass(String cssClass) {
        this.cssClass = cssClass;
    }

    public void setListClass(String listClass) {
        this.listClass = listClass;
    }

    public void setIsDefault(String isDefault) {
        this.isDefault = isDefault;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        SysDictData that = (SysDictData) o;

        return dictCode != null ? dictCode.equals(that.dictCode) : that.dictCode == null;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (dictCode != null ? dictCode.hashCode() : 0);
        return result;
    }
}
